﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_MSDS_Section07View
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hidMSDSID.Value = IIf(IsNothing(Request.QueryString("Id")), 0, CInt(Request.QueryString("Id")))
            ShowData()
        End If
    End Sub
    Protected Sub Translate()
        lblSection07Header.Text = getTranslate("lblSection07Header", Session("LanguageId"), lblSection07Header.Text)
        lblS711.Text = getTranslate("lblS711", Session("LanguageId"), lblS711.Text)
        lblS721.Text = getTranslate("lblS721", Session("LanguageId"), lblS721.Text)
        lblS731.Text = getTranslate("lblS731", Session("LanguageId"), lblS731.Text)
        lblS741.Text = getTranslate("lblS741", Session("LanguageId"), lblS741.Text)
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            'Tiêu đề doanh nghiệp
            Dim lang = CInt(Session("LanguageId"))
            Dim Id As Integer = hidMSDSID.Value
            Dim p As MSDSSection07 = (From a In data.MSDSSection07 Where a.MSDSId = Id And a.LanguageId = lang).SingleOrDefault
            If Not IsNothing(p) Then
                hidID.Value = p.Section07Id

                'Content
                lblViewS711.Text = IIf(IsNothing(p.S711) = True, "", p.S711)
                lblViewS721.Text = IIf(IsNothing(p.S721) = True, "", p.S721)
                lblViewS731.Text = IIf(IsNothing(p.S731) = True, "", p.S731)
                lblViewS741.Text = IIf(IsNothing(p.S741) = True, "", p.S741)
            End If
            'Label
            Translate()
        End Using
    End Sub
End Class
